package com.kmxd.ams.client.archive.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 通用权限设置
 *
 * @author nickbi
 * @since 2022-07-26
 */
@Data
@Schema(description = "通用权限设置对象")
public class ArchiveAuthVO implements Serializable {

  private static final long serialVersionUID = 1L;

  @Schema(description = "主键ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  @Schema(description = "档案类型id")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long archTypeId;

  @Schema(description = "检索范围，1：集团全体，2：本单位全体，3：指定范围，4：无")
  private Integer authType;

  @Schema(description = "检索范围，仅当auth_type(searchscope)为3时生效，，归档部门，有权限为1，没有权限为0")
  private Boolean authTypeFilingDepartment;

  @Schema(description = "检索范围，仅当auth_type为3时生效，经办部门，有权限为1，没有权限为0")
  private Boolean authTypeHandlingDepartment;

  @Schema(description = "检索范围，仅当auth_type为3时生效，经办人，有权限为1，没有权限为0")
  private Boolean authTypeHandlingUser;

  @Schema(description = "利用范围，1：集团全体，2：本单位全体，3：指定范围，4：无")
  private Integer useScope;

  @Schema(description = "利用范围，仅当usescope为3时有效，归档部门，有权限为1，没有权限为0")
  private Boolean useFilingDepartment;

  @Schema(description = "利用范围，仅当usescope为3时有效，经办部门，有权限为1，没有权限为0")
  private Boolean useHandlingDepartment;

  @Schema(description = "利用范围，仅当usescope为3时有效，经办人，有权限为1，没有权限为0")
  private Boolean useHandlingUser;

  @Schema(description = "在线预览，有权限为1，没有权限为0")
  private Boolean onlineBrowser;

  @Schema(description = "在线打印，有权限为1，没有权限为0")
  private Boolean onlinePrint;

  @Schema(description = "下载，有权限为1，没有权限为0")
  private Boolean download;

  @Schema(description = "下载源文件，有权限为1，没有权限为0")
  private Boolean downloadSource;

  @Schema(description = "现场借阅，有权限为1，没有权限为0")
  private Boolean liveRead;

  @Schema(description = "外借，有权限为1，没有权限为0")
  private Boolean lendOut;

  @Schema(description = "复制外发，有权限为1，没有权限为0")
  private Boolean copySend;

  @Schema(description = "摘录，有权限为1，没有权限为0")
  private Boolean excerpt;

  @Schema(description = "创建人")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long createBy;

  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  @Schema(description = "更新人")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long updateBy;

  @Schema(description = "更新时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date updateTime;

  @Schema(description = "删除状态(0-正常,1-已删除)")
  private Long delFlag;
}
